package;

/**
 * ...
 * @author Axel Huizinga axel@cunity.me
 */

class DateFormat 
{
	public var text:String;
	//public var
	
	public function new(withDayTime:Bool = true, withSeconds = false)
	{
		var d:Date = Date.now();
		text = Std.string(d.getDate()) + '.' + Std.string(d.getMonth() +1) + '. ' + Std.string(d.getFullYear());
		if (withDayTime)
		{
			var min:String = Std.string(d.getMinutes());
			var h:String = Std.string(d.getHours());
			text += ' ' + (h.length<2 ? '0' + h : h) + ':' + (min.length<2 ? '0' + min : min);
		}
		if (withSeconds)
			text += ':' + Std.string(d.getSeconds());
	}
	
}